Functions for Timing p4 Programs

timing clocks A small number of simple functions are available for accessing various clocks and timers.

p4_clock
\begin{example}
int p4_clock()
\end{example}
returns a value in milliseconds. This is a wall-clock value, usually obtained from the system via gettimeofday. Also see p4_ustimer below.

p4_ustimer
\begin{example}
p4_usc_time_t p4_ustimer()
\end{example}
returns a wall-clock time value in microseconds. The precision of this number depends on the timer installed on the individual machine. In some cases the resolution may be no greater than that of p4_clock(). For arithmetic and printing purposes, the type p4_usc_time_t is an unsigned long integer.

p4_usrollover
\begin{example}
p4_usc_time_t p4_usrollover()
\end{example}
returns the timer value at which a microsecond timer ``rolls over''. Since p4_usc_time_t is a long integer's worth of microseconds, it is likely that the timer will roll over (become zero) during even medium-length runs.

Functions for Debugging p4 Programs,Miscellaneous Functions,Functions for Timing p4 Programs,Top